// See the Electron documentation for details on how to use preload scripts:
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
const { contextBridge, ipcRenderer, ipcMain } = require("electron");

contextBridge.exposeInMainWorld("electronAPI", {
    closeApp: (isMainWindow) => ipcRenderer.send("close-window", isMainWindow),
    maxApp: () => ipcRenderer.send("max-window"),
    unmaxApp: () => ipcRenderer.send("restore-window"),
    minApp: () => ipcRenderer.send("min-window"),

    onChangeMaxState: (callback) => ipcRenderer.on("change-max-state", callback),
    offChangeMaxState: (callback) => ipcRenderer.off("change-max-state", callback),

});
